<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=">
<title>后台管理系统</title>
<link rel="stylesheet" href="__PUBLIC__/Admin/css/css.css">
		
<script> 
/** 
* 从 file 域获取 本地图片 url 
*/ 
function getFileUrl(sourceId) { 
var url; 
if (navigator.userAgent.indexOf("MSIE")>=1) { // IE 
url = document.getElementById(sourceId).value; 
} else if(navigator.userAgent.indexOf("Firefox")>0) { // Firefox 
url = window.URL.createObjectURL(document.getElementById(sourceId).files.item(0)); 
} else if(navigator.userAgent.indexOf("Chrome")>0) { // Chrome 
url = window.URL.createObjectURL(document.getElementById(sourceId).files.item(0)); 
} 
return url; 
} 

/** 
* 将本地图片 显示到浏览器上 
*/ 
function preImg(sourceId, targetId) { 
var url = getFileUrl(sourceId); 
var imgPre = document.getElementById(targetId); 
imgPre.src = url; 
} 
</script> 
</head>
<body>
<form name="myform" method="post" action="__SELF__" enctype="multipart/form-data">
<div class="list">
	  <table width="100%" border="0" cellpadding="0" cellspacing="0" class="details">
        <tbody>
	      <tr>
	        <td width="27%" style="border-top:0;"><div align="right">广告位名称：</div></td>
	        <td width="73%" style="border-top:0;"><label for="select"></label>
	          <select name="ad_space_id" id="ad_space_id">
              	<option value="{$result.ad_space_id}">{$result.ad_space_name}</option>
                <option value="">----------------------</option>
              <foreach name="result_space" item="vo_space">
              	<option value="{$vo_space.id}">{$vo_space.name}</option>
                </foreach>
            </select></td>
          </tr>
          <tr>
            <td width="27%" style="border-top:0;"><div align="right">分类检索：</div></td>
            <td width="73%" style="border-top:0;">
                <select name="type" id="type">
                      <option value="{$result.type}">
                      	<if condition="$result.type eq 1">pc首页
                      	<elseif condition="$result.type eq 3"/>pc会员专区
                      	<!--<elseif condition="$result.type eq 4"/>pc合伙人专区  -->
                      	<elseif condition="$result.type eq 5"/>手机首页
                      	<!-- <elseif condition="$result.type eq 7"/>手机会员专区  -->
                      	<!-- <else/>手机合伙人专区</if>  -->
                    </option>
                      <option value="1">pc首页</option>
                       <!--<option value="2">pc旅游</option>-->
                      <option value="3">pc会员专区</option>
                      <!-- <option value="4">pc合伙人专区</option>-->
                      <option value="5">手机首页</option>
                      <!-- <option value="6">手机旅游</option> -->
                      <option value="7">手机会员专区</option>
                       <!-- <option value="8">手机合伙人专区</option> -->
                </select>
            </td>
          </tr>
	      <tr>
	        <td style="border-top:0;"><div align="right">广告名称：</div></td>
	        <td style="border-top:0;">
	          <label for="ad_name"></label>
	          <input class="input" type="text" name="title" id="title" style="width:245px;" value="{$result.title}">
            </td>
          </tr>
	      <tr>
	        <td style="border-top:0;"><div align="right">背景颜色值：</div></td>
	        <td style="border-top:0;">
			<input type="text" name="color_val" value="{$result.color_val}" style="color:{$result.color_val}; width:120px;" placeholder="格式：#F0F0F0" /> 
			<input type="text" style="width:24px; height:24px; background:{$result.color_val}" readonly="readonly" />

            </td>
          </tr>		  
	      <tr>
	        <td><div align="right">广告跳转地址：</div></td>
	        <td>
	          <label for="ad_link"></label>
	          <input class="input" type="text" name="ad_link" id="ad_link" style="width:345px;" value="{$result.ad_link}"> 
	          100个字符内
            </td>
          </tr>
          <tr>
            <td>&nbsp;</td>
            <td><a target="_blank" href={$result.pic_url}">
			<img style="width:100px; height:80px;" src="{$result.pic_url}"></a></td>
          </tr>
          <tr>
	        <td><div align="right">广告图片：</div></td>
	        <td>
	          <input type="file" name="pic_url" id="pic_url" onchange="preImg(this.id,'imgPre');" /> 
              <br/><img id="imgPre" src="" width="360px" height="82px" style="display: block;" /> 
            </td>
          </tr>
          <tr>
            <td><input type="hidden" name="id" value="{$result.id}" /></td>
            <td><button type="submit" class="button" id="button" style="min-width:160px;" onclick="admin_add();">确 认</button></td>
          </tr>
         </tbody>
  		</table>
</div>
</form>
</body>
</html>
